import React, { useState, useEffect, useRef } from 'react'
import axios from 'axios'
import { useNavigate, Outlet } from 'react-router-dom'
import { useThrottleFn } from 'ahooks';
import './setting.css'
// import { Form } from "antd";
import { AntOutline } from 'antd-mobile-icons'
import { Switch } from 'antd-mobile'
import { Cell } from 'react-vant'
import { FireO, LocationO } from '@react-vant/icons'
const List = (props) => {
    const navigater = useNavigate()
    const [c, setC] = useState(['', '', ''])
    const cel = (val) => {
        const ce = [...c]
        ce.forEach((item, index) => {
            if (index == val) {
                ce[index] = <svg t="1730447937719" className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5448" width="200" height="200"><path d="M939.36 218.912a32 32 0 0 1 45.856 44.672l-538.016 552a32 32 0 0 1-43.776 1.92L63.872 526.048a32 32 0 1 1 41.696-48.544l316.768 271.936L939.36 218.88z" fill="#1296db" p-id="5449"></path></svg>

            } else {
                ce[index] = ''
            }
        })
        setC(ce)
    }
    return (
        <div className='setting-liao'>
            <div className="order-title">
                <div className="t1" onClick={() => { window.history.back() }}><svg t="1730286914624" className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="16962" width="200" height="200"><path d="M622.927311 789.137615c-6.503881 0-13.007763-2.16796-18.066337-7.226535l-231.249118-231.249118c-10.117149-10.117149-15.898377-23.847565-15.898377-39.023289 0-14.45307 5.781228-28.183486 15.898377-39.023288l231.971771-231.971772c10.117149-10.117149 26.015526-10.117149 35.410022 0 10.117149 10.117149 10.117149 26.015526 0 35.410021l-231.249118 231.971772c-0.722653 0.722653-1.445307 2.16796-1.445307 2.890614 0 0.722653 0 2.16796 1.445307 2.890614l231.249118 231.249118c10.117149 10.117149 10.117149 26.015526 0 35.410021-5.058574 5.781228-11.562456 8.671842-18.066338 8.671842z" fill="#2c2c2c" p-id="16963"></path></svg></div>
                <div className="t2"><span>消息设置</span></div>
                <div className="t3"></div>
            </div>
            <div className="setting-body">
                <div className="setting-title">
                    <span>通知设置</span>
                </div>
                <div className="setting-bo">
                    <div className="setting-dy">
                        <div className="setting-zuo">
                            <span>订单消息</span>
                        </div>
                        <div className="setting-you">
                            <Switch />
                        </div>
                    </div>
                    <div className="setting-dy">
                        <div className="setting-zuo">
                            <span>互动消息</span>
                        </div>
                        <div className="setting-you">
                            <Switch />
                        </div>
                    </div>
                </div>
                <div className="setting-title">
                    <span>谁可以私信我</span>
                </div>
                <div className="setting-tex">
                    <Cell.Group card>
                        <Cell title='所有人' value={c[0]} onClick={() => { cel(0) }} />
                        <Cell title='互相关注的驴友' value={c[1]} onClick={() => { cel(1) }} />
                        <Cell title='不接收私信' value={c[2]} onClick={() => { cel(2) }} />
                    </Cell.Group>
                </div>
            </div>
        </div>
    )
}
export default List